Skip to content
+91-8802000175info@websjyoti.com
Join PHP Internship

PHP Training in Gurgaon

PHP Full Stack Developer Training

  • PHP Laravel
  • Digital Marketing
  • MERN Stack
  • Placements
  • Locations
    • Muzaffarpur Location
    • Php Training in Baksar
    • Php Training in Balia
    • PHP Training Gorakhpur
    • PHP Training in Patna
    • Training in Bangalore
    • PHP Training in Noida
    • PHP Training in Delhi
    • Training in Ghaziabad
  • CONTACT

PHP – Strings Functions

  • Home
  • php-training-in-gurgaon
  • PHP – Strings Functions
9 Apr 2017
hirdeshphp-training-in-gurgaon6 months php training in gurgaon, best php ajax institutes in gurgaon, best php authors from india, best php coaching gurgaon, best php institutes in gurgaon, best php training gurgaon, best php training institute in gurgaon, best php training institute in sector 14, buy php book online, free php tutorials, learn php in gurgaon, learn php in gurgaon haryana, learn php online, php, php ajax real time training in gurgaon, php summer training institutes in gurgaon, php training and placement institutes in gurgaon, php training center in gurgaon haryana, php training company in gurgaon, php training course gurgaon, php training in gurgaon, php training institute gurgaon haryana, php training institutes in gurugram haryana, strings functions in php

String functions are the most important functions frequently used in PHP. String is the sequence of characters, like “Let’s learn String functions”. There is no installation required to use string function.

Example

<?php

$name = “Hirdesh Bhardwaj”;

print($name);

?>

String Concatenation Operator

To concatenate two string variables together, we use the dot (.) operator −

<?php

$txt1=”Hello Readers”;

$txt2=”8756″;

echo $txt1 . ” ” . $txt2;

?>

Using the strlen() function

The strlen() function is used to get the length of a string.

<?php

$txt=”Webs Jyoti”;

echo strlen($txt);

?>

This will produce the following result – 10 (including space)

Using the strpos() function

The strpos() function is used to search for a text or character within a string. If the value is found then this will return the position of the first value. If no match is found, it will return FALSE.

Let’s see if we can find the string “PHP” in our string −

<?php

echo strpos(“Hello PHP”,”PHP”);

?>

This will produce the following result – 6

The explode() Function: Used to convert strings into an array variable.

Example:

$db = explode(‘;’,”host=localhost;db=hirdesh;uid=root “);

print_r($settings);

Output:

Array ( [0] => host=localhost [1] => db=hirdesh [2] => uid=root [3]

The substr() Function:

The substr() is used to return part of the string. It accepts three (3) basic parameters. The first one is the string to be shortened, the second parameter is the position of the starting point, and the third parameter is the number of characters to be returned.

 

The md5() Function: Used to calculate the md5 hash of a string value. This could be used where you want to convert your password from plain text to hash code to prevent the use of unauthorized users.

 

The trim() function : the Trim() is used to remove white spaces and predefined characters from a both the sides of a string.

Syntax

trim(string,charlist)

The str_replace() function: This can be used where you just want to swap out words or a set of characters in a string and replace them with something else.

Post navigation

OOPs Concepts – PHP
Error Handling in PHP

Recent Posts

  • Webs Jyoti Conducted an Internship Program at St. Andrews College
  • Webs Jyoti Welcomes Interns from Symbiosis
  • Students Successfully Placed through Webs Jyoti in Various Profiles
  • PHP Training and Placement Experience at Webs Jyoti
  • 5 reason why digital marketing is important

Placement Corner

Excel Trainer
PHP trainer
Digital Marketing trainer
Advance Excel Trainer
SQL Trainer
Webs jyoti Placement
PHP traning Gurgaon
Webs Jyoti Placement
digital marketing
excel training Webs Jyoti
PHP Placement
SQL Training for Webs Jyoti
Webs Jyoti Placement
Trainer From Websjyoti
Digital marketing placement
PHP Training in Gurgaon
Excel training in gurgaon
MY SQL placement
Excel placement
Digital Marketing placement
PHP placement
advance excel placement
digital Marketing placement
SEO Placement
Java Script Placement
Advance excel placement
php placement
web development
Excel trainer
PHP placement
websjyoti Placement
php traning in gurgaon
Webs Jyoti placemnt
digital marketing placement
Webs Jyoti placement
PHP Traning in Gurgaaun
Advance excel placement
MY SQL placement
Web development
Excel Trainer
Webs Jyoti Placement
Webs Jyoti Placement
PHP placement
Digital Marketing placement
SEO experts
SMO placement
Webs Jyoti Placement
Webs Jyoti Placement
Advance Excel Placement
Webs Jyoti Placement
Webs Jyoti Placement
Graphic Designer
Advance Excel Placement
Webs Jyoti Placement
Excel Placement
Webs Jyoti Placement
Digital Marketing Placement
Webs Jyoti Placement
Excel Placement
Advance Excel Placement

Contact us

Webs Jyoti - M-24, Old DLF Colony, Sector 14, Gurgaon, Haryana 122001

Contact: +91-8802000175

Email: info@websjyoti.com

© 2024 Webs Jyoti, All right reserved. Proudly Powered By Webs Jyoti

Education Base by Acme Themes

WhatsApp us